using System;
using System.Collections.Generic;
using Webshop20.Domain.Catalog.Core;

namespace Webshop20.UnitTests.Builder
{
    public class BuildShoppingCart
    {
        private ShoppingCart cart;
        private IEnumerable<ShoppingCartItem> cartItems = new List<ShoppingCartItem>();

        public BuildShoppingCart()
        {
            cart = new ShoppingCart();
            var product = new BuildProduct();
            product = new BuildProduct();
            cart.AddProduct(product, DateTime.Now);
            cart.AddProductToSavedItemList(product );
        }

        public BuildShoppingCart WithCartItems(IEnumerable<ShoppingCartItem> cartItems)
        {
            this.cartItems = cartItems;
            return this;
        }

        public static implicit operator ShoppingCart(BuildShoppingCart buildVisitor)
        {
            return buildVisitor.Build();
        }

        private ShoppingCart Build()
        {
            return cart;
        }
    }
}